<!-- 默认客户注册权限 -->
<template>
<div ref="tableScrollBar" class="content-box">
    <el-tabs type="border-card"  @tab-click="tabClick">
      <el-tab-pane key="1" :label="$t('DefaultCustomerPermissionsLang.tabs')">
        <div class="contant">
          <div class="contant_left">
            <div class="boxHeader">
              <span style="font-weight: bold;display: flex;align-items: center;justify-content: space-between;">
                {{$t('DefaultCustomerPermissionsLang.RoleCustomerList')}}
                <div class="btnGroup">
                  <img @click="add('RoleCustomerLeft')" style="width:20px" src="@/assets/img/添加.png" alt=""> 
                  <img @click="edit('RoleCustomerLeft')" style="width:20px;margin:0 5px;" src="@/assets/img/编辑.png" alt="">  
                  <img @click="del('RoleCustomerLeft')" style="width:20px" src="@/assets/img/删除.png" alt="">
                </div>  
              </span>
            </div>
            <RoleCustomerLeft ref="RoleCustomerLeft"></RoleCustomerLeft>
          </div>
          <div class="contant_right" style="position: relative;">
            <div class="boxHeader">
              <span style="font-weight: bold;">{{$t('DefaultCustomerPermissionsLang.RoleList')}}</span>
            </div>
            <RoleCustomerRight ref="RoleCustomerRight"></RoleCustomerRight>
          </div>
        </div>
      </el-tab-pane>
      <el-tab-pane key="2" :label="$t('DefaultCustomerPermissionsLang.tabs1')">
        <div class="contant">
          <div class="contant_left">
            <div class="boxHeader">
              <span style="font-weight: bold;display: flex;align-items: center;justify-content: space-between;">
                {{$t('DefaultCustomerPermissionsLang.RoleCustomerList')}}
                <div class="btnGroup">
                  <img @click="add('DefaultCustomerPermissionsLeft')" style="width:20px" src="@/assets/img/添加.png" alt=""> 
                  <img @click="edit('DefaultCustomerPermissionsLeft')" style="width:20px;margin:0 5px;" src="@/assets/img/编辑.png" alt="">  
                  <img @click="del('DefaultCustomerPermissionsLeft')" style="width:20px" src="@/assets/img/删除.png" alt="">
                </div>  
              </span>
            </div>
            <DefaultCustomerPermissionsLeft ref="DefaultCustomerPermissionsLeft"></DefaultCustomerPermissionsLeft>
          </div>
          <div class="contant_right">
            <div class="boxHeader">
              <span style="font-weight: bold;">{{$t('DefaultCustomerPermissionsLang.RoleAuthorization')}}</span>
            </div>
            <DefaultCustomerPermissionsRight ref="DefaultCustomerPermissionsRight"></DefaultCustomerPermissionsRight>
          </div>
        </div>
      </el-tab-pane>
      <el-tab-pane key="3" :label="$t('DefaultCustomerPermissionsLang.tabs2')">
        <div class="contant">
          <div class="contant_left">
            <div class="boxHeader">
              <span style="font-weight: bold;display: flex;align-items: center;justify-content: space-between;">
                {{$t('DefaultCustomerPermissionsLang.RoleCustomerList')}}
                <div class="btnGroup">
                  <img @click="add('APPPermissionConfigurationLeft')" style="width:20px" src="@/assets/img/添加.png" alt=""> 
                  <img @click="edit('APPPermissionConfigurationLeft')" style="width:20px;margin:0 5px;" src="@/assets/img/编辑.png" alt="">  
                  <img @click="del('APPPermissionConfigurationLeft')" style="width:20px" src="@/assets/img/删除.png" alt="">
                </div>  
              </span>
            </div>
            <APPPermissionConfigurationLeft ref="APPPermissionConfigurationLeft"></APPPermissionConfigurationLeft>
          </div>
          <div class="contant_right">
            <div class="boxHeader">
              <span style="font-weight: bold;">{{$t('DefaultCustomerPermissionsLang.RoleAuthorization')}}</span>
            </div>
            <APPPermissionConfigurationRight ref="APPPermissionConfigurationRight"></APPPermissionConfigurationRight>
          </div>
        </div>
      </el-tab-pane>
    </el-tabs>
  </div> 
</template>

<script>
import RoleCustomerLeft from "./roleCustomer_left";
import RoleCustomerRight from "./roleCustomer_right";
import DefaultCustomerPermissionsLeft from "./DefaultCustomerPermissions_left";
import DefaultCustomerPermissionsRight from "./DefaultCustomerPermissions_right";
import APPPermissionConfigurationLeft from "./APP_permissionConfiguration_left";
import APPPermissionConfigurationRight from "./APP_permissionConfiguration_right";
export default {
  components: {
    RoleCustomerLeft,
    RoleCustomerRight,
    DefaultCustomerPermissionsLeft,
    DefaultCustomerPermissionsRight,
    APPPermissionConfigurationLeft,
    APPPermissionConfigurationRight,
  },
  data(){
    return{

    }
  },
  mounted(){
    this.$refs.RoleCustomerLeft.getLeftList()
  },
  methods:{
    tabClick(targetNode) {
      targetNode.$children[0].getLeftList()
    },
    add(refName){
      this.$refs[refName].add()
    },
    edit(refName){
      this.$refs[refName].edit()
    },
    del(refName){
      this.$refs[refName].del()
    },
  }
}
</script>
<style scoped lang="less">
.el-tabs{
  height: 100%;
}
/deep/.el-tabs--border-card>.el-tabs__content{
  padding: 0;
  height: calc(100% - 40px);
  .el-tab-pane{
    height: 100%;
  }
}
/deep/.el-tabs__item{
    height: 30px;
    line-height: 30px;
    margin: 5px !important;
    border: 1px solid #ccc !important;
    border-radius: 3px;
    background-color:#fff;
  }
/deep/.el-tabs__item.is-active{
  color: #fff !important;
  background-color:#6c9ee5 !important;
}
.contant{
  height: 100%;
  display: flex;
  .contant_left{
    width: 200px;
    box-shadow: rgb(230, 223, 223) 7px 0px 8px;
    margin-right: 10px;
  }
  .contant_right{
    flex: 1;
    overflow-x: auto;
  }
  .boxHeader{
    height: 30px;
    line-height: 30px;
    background-color: #6c9ee5;
    color: #fff;
    padding: 0 10px;
  }
}
</style>